<?php

use think\Route;

//地址簿相关
Route::post('user/addressBook', 'api/AddressBook/add');
Route::put('user/addressBook', 'api/AddressBook/update');
Route::delete('user/addressBook', 'api/AddressBook/delete');
Route::get('user/addressBook/list', 'api/AddressBook/list');
Route::get('user/addressBook/default', 'api/AddressBook/default');
Route::put('user/addressBook/default', 'api/AddressBook/setDefault');
Route::get('user/addressBook/:id', 'api/AddressBook/read',[],['id' => '\d+']);

return [
    //别名配置,别名只能是映射到控制器且访问时必须加上请求的方法
    '__alias__'   => [],
    //变量规则
    '__pattern__' => [],
    // 域名绑定到模块
    // '__domain__'  => [
    //     'admin' => 'admin',
    //     'api'   => 'api',
    // ],
    '[user]' => [
        //用户相关
        'user/login' => ['api/User/login', ['method' => 'post']],
        'user/register' => ['api/User/register', ['method' => 'post']],
        'user/logout' => ['api/User/logout', ['method' => 'post']],
        // 分类相关
        'category/list' => ['api/Category/list', ['method' => 'get']],
        // 菜品相关
        'dish/list' => ['api/Dish/list', ['method' => 'get']],
        // 套餐相关
        'setmeal/list' => ['api/Setmeal/list', ['method' => 'get']],
        'setmeal/dish/:id' => ['api/Setmeal/dishList', ['method' => 'get'], ['id' => '\d+']],
        // 店铺操作
        'shop/status' => ['api/Shop/status', ['method' => 'get']],
        // 购物车相关
        'shoppingCart/add' => ['api/ShoppingCart/add', ['method' => 'post']],
        'shoppingCart/list' => ['api/ShoppingCart/list', ['method' => 'get']],
        'shoppingCart/clean' => ['api/ShoppingCart/clean', ['method' => 'delete']],
        'shoppingCart/sub' => ['api/ShoppingCart/sub', ['method' => 'post']],
        // 订单相关
        'order/submit' => ['api/Orders/submit', ['method' => 'post']],
        'order/payment' => ['api/Orders/payment', ['method' => 'put']],
        'order/historyOrders' => ['api/Orders/historyOrders', ['method' => 'get']],
        'order/orderDetail/:id' => ['api/Orders/orderDetail', ['method' => 'get'], ['id' => '\d+']],
        'order/cancel/:id' => ['api/Orders/cancel', ['method' => 'put'], ['id' => '\d+']],
        'order/repetition/:id' => ['api/Orders/repetition', ['method' => 'post'], ['id' => '\d+']],
        'order/reminder/:id' => ['api/Orders/reminder', ['method' => 'get'], ['id' => '\d+']],
    ],

];
